package com.wyr.proxyfactory;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class MyCountMethodInterceptor implements MethodInterceptor {

    private int invocationCount = 0;

    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        System.out.println(++invocationCount);
        Object result=invocation.proceed();
        return result;
    }
}
